<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			window.onload = function() {
				var arr = ["red", "blue", "white", "black", "orange", "green"];
				var oBox = document.getElementById("box");
				
				//console.log(parseInt("14px")); //14
				
				var change = 5; //文字大小变化量
				var i = 0; 
				setInterval(function(){
					
//					console.log(oBox.style.fontSize); //14px
					var fontSize = parseInt(oBox.style.fontSize);
					oBox.style.fontSize = fontSize + change + "px";
					oBox.style.color = arr[i%6]; //改变颜色
					i++;
					if (i%6 == 0) {
						change *= -1;
					}
					
				}, 100);
				
			}
		</script>
	</head>
	<body>
		<div id="box" style="background: purple; font-size: 14px; width: 200px; height: 200px;">看我72变</div>
	</body>
</html>
